package com.mycompany.lctwitter.action.user;

import java.util.List;

import javax.annotation.Resource;

import com.mycompany.lctwitter.action.AbstractAction;
import com.mycompany.lctwitter.persist.model.Location;
import com.mycompany.lctwitter.persist.service.LocationService;

public class LoginPageAction extends AbstractAction {

    private static final long serialVersionUID = -9103323436610779285L;

    private List<Location> locations;

    @Resource
    private LocationService locationService;

    public List<Location> getLocations() {
        return locations;
    }

    public void setLocations(List<Location> locations) {
        this.locations = locations;
    }

    @Override
    public String execute() {
        session.clear();
        this.locations = locationService.list();
        return SUCCESS;
    }

}
